def swap(a, m, n):
    t = a[n]
    a[n] = a[m]
    a[m] = t


b = input("请输入一个由不同数字组成的数列，由空格分隔\n").split(' ')
a = list()
for i in range(len(b)):
    a.append(int(b[i]))
m = a.index(max(a))
n = a.index(min(a))
print(a)
swap(a, m, n)
print(a)
